//
//  Base64Utility.swift
//  KCSwift
//
//  Created by apple on 2023/7/31.
//

import Foundation

class Base64Utility {
    static func encodeString(_ string: String) -> String? {
        
        guard let data = string.data(using: .utf8) else {
            return nil
        }
        return data.base64EncodedString()
    }
        
    static func decodeString(_ base64String: String) -> String? {
        guard let data = Data(base64Encoded: base64String) else {
            return nil
        }
        return String(data: data, encoding: .utf8)
    }

}
